<template>
    <div ref="refEmpty" :style="`height: ${mainHeight}px;`">
        <el-empty />
    </div>
  </template>
  
  <script>
  export default {
    beforeCreate() {
          this.$nextTick(() => {
              // 根据浏览器高度设置初始高度
              const refsSearchHeader = this.$refs.refEmpty.parentElement.parentElement.parentElement.firstElementChild
              const refsSearchTab = this.$refs.refEmpty.parentElement.firstElementChild
              // const refsSearchTextListComponentFooter = this.$refs.refsSearchTextListComponentFooter.$el
              const refsSearchFooter = this.$refs.refEmpty.parentElement.parentElement.parentElement.children[2]
              this.titleTextWidth = document.body.offsetWidth - 20 - 52
              // 监听浏览器高度变化，修改表格高度
              window.addEventListener('resize', () => {
                  this.mainHeight = document.body.offsetHeight
                      - refsSearchHeader.offsetHeight
                      //     - refsSearchTextListComponentFooter.offsetHeight
                      - refsSearchTab.offsetHeight
                      - refsSearchFooter.offsetHeight
              })
          })
      },
      beforeMount() {
          this.$nextTick(() => {
              const refsSearchHeader = this.$refs.refEmpty.parentElement.parentElement.parentElement.firstElementChild
              const refsSearchTab = this.$refs.refEmpty.parentElement.firstElementChild
              //    const refsSearchTextListComponentFooter = this.$refs.refsSearchTextListComponentFooter.$el
              const refsSearchFooter = this.$refs.refEmpty.parentElement.parentElement.parentElement.children[2]
              this.mainHeight = document.body.offsetHeight
                  - refsSearchHeader.offsetHeight
                  //     - refsSearchTextListComponentFooter.offsetHeight
                  - refsSearchTab.offsetHeight
                  - refsSearchFooter.offsetHeight
          })
      },
      data(){
        return {
          mainHeight: 0
        }
      }
  }
  </script>
  
  <style>
  
  </style>